package horncomb.bpm.process.def.state;

import horncomb.bpm.BpmContextHolder;
import horncomb.bpm.process.core.ProcessDefinition;

/**
 * @author Daniel
 */
public abstract class AbstractProcessStateDefinition extends
		DefaultStateDefinition {
	private static final long serialVersionUID = -2697535834439735195L;

	private String innerProcessDefinitionId;

	/**
	 * @param id
	 */
	public AbstractProcessStateDefinition(String id) {
		super(id);
	}

	public ProcessDefinition getInnerProcessDefinition() {
		return BpmContextHolder.getContext().getProcessManagementService()
				.findProcessDefinition(this.innerProcessDefinitionId);
	}

	/**
	 * @return the nestedProcessDefinitionId
	 */
	public String getInnerProcessDefinitionId() {
		return innerProcessDefinitionId;
	}

	/**
	 * @param nestedProcessDefinitionId
	 *            the nestedProcessDefinitionId to set
	 */
	public void setInnerProcessDefinitionId(String nestedProcessDefinitionId) {
		this.innerProcessDefinitionId = nestedProcessDefinitionId;
	}

}